<template>
  <div class="login">
    <card header-text="登录">
      <div class="card-body card-block" style="opacity: 0.75;">
        <form :model="formData" name="login">
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-university"></i></div>
              <input type="text" id="department" v-model="formData.department" name="department" placeholder="部门" class="form-control">
            </div>
          </div>
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-envelope"></i></div>
              <input type="text" id="account" v-model="formData.account" name="account" placeholder="账号" class="form-control">
            </div>
          </div>
          <div class="form-group">
            <div class="input-group">
              <div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
              <input type="password" id="password" v-model="formData.password" name="password" placeholder="密码" class="form-control">
            </div>
          </div>
          <div class="form-actions form-group">
              <center><button @click="login" class="btn btn-primary btn-md" style="width:200px;">登录</button></center>
          </div>
        </form>
      </div>
    </card>
  </div>
</template>

<script>
import axios from 'axios'

export default {
  name: 'Login',
  data() {
    return {
      dialogVisible:false,
      formData: {
        account:null,
        password:null
      },
      heatExchanges:[]
    }
  },
  mounted() {
  },
  methods:{
    login(){
      // this.$axios.post("http://101.201.68.169:8887/v1/auth/login",{
      //   department:this.formData.department,
      //   account:this.formData.account,
      //   password:this.formData.password,
      // }).then((res) => {
      //   showmain()
      // },err=>{
      //   console.log(err)
      // });
      this.showmain();
    },
    showmain(){
      this.$router.push('/user_management');
    }
  }
}
</script>

<style lang="scss" scoped>
  .card-title{
    padding-left: 20px;
  }
</style>